<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: xueya
  Date: 2025/8/12
  Time: 22:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    ArrayList <String> arrayList = new ArrayList<>();
    arrayList.add("张三");
    arrayList.add("李四");
    arrayList.add("王五");
    arrayList.add("赵六");
    request.setAttribute("list",arrayList);
%>
<%--< table border="1" width="500">--%>
<table width="300px" border="1" cellspacing="0">
<tr>
    <td>序号</td>
    <td>姓名</td>
</tr>
<c:if test="${list.size()>0}">
    <c:forEach items="${list}" var="element" varStatus="index">
        <tr>
            <td>${index.count}</td>
            <td>${element}</td>
        </tr>
    </c:forEach>
</c:if>


</table>

</body>
</html>
